package com.example.meetingbook.controller;

import com.example.meetingbook.model.Employee;
import com.example.meetingbook.service.MeetingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpSession;

/**
 * @author 麦健豪
 * @date 2021/12/24 18:17
 */
@Controller
public class NotificationsController {

    @Autowired
    MeetingService meetingService;


    @GetMapping("/notifications")
    public String Notifications(Model model, HttpSession session) {

        Employee currentuser = (Employee) session.getAttribute("currentuser");
        Integer employeeid = currentuser.getEmployeeid();


        model.addAttribute("ms", meetingService.getSevenDayMeeting(employeeid));

        model.addAttribute("cms", meetingService.getCancelMeeting());

        return "notifications";
    }
}
